<template>
	<div class="document-left">
		<div class="document-left-show" :class="[catalogueType == false?'showTwo':'hiddenTwo']" @click="loadCatalogueShow">
			<span class="document-left-show-title">文</span>
			<span class="document-left-show-title">档</span>
		</div>
		<div class="menu-handle-bar">
			<div v-if="catalogueType == true" class="menu-handel-bar-itembox" @click="loadCatalogueHidden">
				<i class="menu-handel-bar-itembox-icon el-icon-arrow-left"></i>
			</div>
		</div>
		<div class="document-left-content" :class="[catalogueType == true?'show':'hidden']">
			<div class="document-left-function">
				 <span class="document-left-function-item" style="margin-bottom:16px">所有成员：20人</span>
				 <el-progress :percentage="percentage" :show-text='showtext'></el-progress>
				 <!-- <span style="font-size:13px;margin-bottom:8px" >成员配额：15/20人</span> -->
		<!-- 		<div class="document-left-function-item" v-for="(item,index) in functionForm">
					<span class="document-left-function-item-title" @click="loadFunction(index)"
						:class="[functionIndex == index?'choose-color':'']">{{item.title}}</span>
				</div> -->
			</div>
			<div class="document-left-tree">
				<el-tree :data="treeData" node-key="id" :expand-on-click-node="false">
					<span class="custom-tree-node" slot-scope="{ node, data }">
						<img class="svg-icon"
							:src="data.src?data.src:folderIcon">
						<span class="document-left-tree-span">{{data.label}}</span>
						<div class="document-left-tree-iconBox">
						</div>
					</span>
				</el-tree>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
                folderIcon: require("../../../img/8eacfb1a6bafde0a172c6b393950dab8.svg"),
				showtext:false,
				percentage:50,
				functionForm: [{
						title: '外包成员',
						icon: 'el-icon-time'
					},
					{
						title: '已锁定成员',
						icon: 'el-icon-user'
					},
					{
						title: '企业外成员',
						icon: 'el-icon-star-off'
					},
				],
				functionIndex: -1,
				treeData: [{
					id: 1,
					label: 'java开发小组',
					src: require("../../../img/0aa34d50b616e6482cfb8ea7cf251d5b.svg"),
					// children: [{
					// 	id: 4,
					// 	label: '二级 1-1大风大浪开始范德萨',
					// 	children: [{
					// 		id: 9,
					// 		label: '三级 1-1-1f大风大浪开始范德萨'
					// 	}, {
					// 		id: 10,
					// 		label: '三级 1-1-2'
					// 	}]
					// }]
				}, {
					id: 2,
					label: 'PHP开发小组',
					src: require("../../../img/0aa34d50b616e6482cfb8ea7cf251d5b.svg"),
					// children: [{
					// 	id: 5,
					// 	label: '二级 2-1'
					// }, {
					// 	id: 6,
					// 	label: '二级 2-2'
					// }]
				}, {
					id: 3,
					label: 'python开发小组',
					src: require("../../../img/0aa34d50b616e6482cfb8ea7cf251d5b.svg"),
					// children: [{
					// 	id: 7,
					// 	label: '二级 3-1'
					// }, {
					// 	id: 8,
					// 	label: '二级 3-2'
					// }]
				}],
				catalogueType: true
			}
		},
		methods: {
			loadFunction(index) {
				var _this = this
				if (_this.functionIndex == index) {
					_this.functionIndex = -1
				} else {
					_this.functionIndex = index
				}
			},
			loadCatalogueShow(){
				this.catalogueType = true
			},
			loadCatalogueHidden(){
				this.catalogueType = false
			}
		}
	}
</script>

<style scoped>
	.document-left {
		display: flex;
		flex-flow: column nowrap;
		align-items: stretch;
		flex: 0 0 auto;
		position: relative;
		height: calc(100vh - 84px);
	}

	.document-left-content{
		/* overflow: hidden; */
	}

	.show {
		width: 232px;
		transition: all .5s;
		overflow-y: auto;
		overflow-x: hidden;
	}

	.hidden {
		width: 30px;
		transition: all .5s;
		overflow: hidden;
	}

	.document-left-function {
		padding: 24px;
		border-bottom: 1px solid #dadee3;
		width: 232px;
		box-sizing: border-box;
	}

	.document-left-function-item {
		display: flex;
		flex-direction: row;
		align-items: center;
		padding-top: 8px;
		padding-bottom: 8px;
		color: #5f6d84;
		cursor: pointer;
	}

	.document-left-function-item-icon {
		font-size: 16px;
		color: #c1c7d0;
		margin-right: 12px;
	}

	.document-left-function-item-title {
		font-size: 14px;
	}

	.document-left-function-item:hover {
		color: #2c7ef8;
	}

	.choose-color {
		color: #2c7ef8;
	}

	.menu-handle-bar {
		position: absolute;
		top: 0px;
		right: -10px;
		width: 10px;
		height: calc(100vh - 84px);
		background-color: white;
		display: flex;
		flex-direction: row;
		align-items: center;
		border-left: 1px solid #dadee3;
	}

	.menu-handel-bar-itembox {
		width: 12px;
		height: 56px;
		border-top-right-radius: 10px;
		border-bottom-right-radius: 10px;
		background-color: white;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.menu-handle-bar:hover>.menu-handel-bar-itembox {
		background-color: #2c7ef8;
	}

	.menu-handel-bar-itembox-icon{
		font-size: 12px;
		color: white;
	}

	.document-left-tree {
		padding: 20px;
		position: relative;
		width: 232px;
		overflow: hidden;
	}

	.custom-tree-node {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 14px;
		/* padding-right:20px; */
		color: white;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.custom-tree-node:hover {
		color: #909BAA;
		padding-right: 22px;
	}

	.svg-icon {
		width: 18px;
		height: 18px;
		margin-right: 6px;
		flex-shrink: 0;
	}

	.document-left-tree-span {
		flex: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		color: #5f6d84;
		font-size: 14px;
	}

	.document-left-tree-more {
		font-size: 12px;
	}

	.document-left-tree-iconBox {
		position: absolute;
		right: 10px;
		padding-top: 10px;
		padding-bottom: 10px;
	}

	.document-left-show{
		width: 30px;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		position: absolute;
		top: 0;
		bottom: 0;
		background-color: white;
		z-index: 99;
	}
	.document-left-show-title{
		font-size: 12px;
		color: #909AAA;
		margin-top: 10px;
	}

	.showTwo{
		opacity: 1;
		transition: all .5s;
	}

	.hiddenTwo{
		opacity: 0;
		transition: all .5s;
	}
</style>
